package org.benxiong.iplay.ui.component;

import android.content.Context;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;

/**
 * For one thumbnail in search member list view
 * 
 * @author Ben
 * 
 */
public class UserThumbnailView extends ImageButton {
	private UserThumbnailView	thumbnail;
	private TextView			textView;
	private ImageView			onlineStatusView;

	public UserThumbnailView(Context context, UserThumbnailView thumbnail, OnClickListener listener) {
		super(context);
		this.thumbnail = thumbnail;
		this.setOnClickListener(listener);
		this.refreshView();
	}

	private void refreshView() {
		// TODO (optional) resize

		// TODO load image

		// TODO update text view

		// TODO update online status
	}

	public UserThumbnailView getThumbnail() {
		return thumbnail;
	}

	public void setThumbnail(UserThumbnailView thumbnail) {
		this.thumbnail = thumbnail;
		this.refreshView();
	}

	public TextView getTextView() {
		if (textView == null) {
			// TODO: create textview
		}
		return textView;
	}

	public void setTextView(TextView textView) {
		this.textView = textView;
	}

	public ImageView getOnlineStatusView() {
		if (onlineStatusView == null) {
			// TODO:create online status view
		}
		return onlineStatusView;
	}

	public void setOnlineStatusView(ImageView onlineStatusView) {
		this.onlineStatusView = onlineStatusView;
	}

}
